package com.yjc.drygoods.product.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author yjc
 * @create 2022-09-12 10:07
 */
@Configuration
public class MyRedissonConfig {

    @Bean
    public RedissonClient redisson() {
        //1.创建配置
        Config config = new Config();
        config.useSingleServer().setAddress("redis://192.168.100.161:6379");

        //2.根据Config创建出RedissonClient示例
        RedissonClient redissonClient = Redisson.create(config);
        return redissonClient;
    }
}
